#ifndef _MOVE_H_
#define _MOVE_H_

#define MAX_MOVES	256 // Max. number of legal moves in any BoardState

#include <iostream>
#include <cstring>

// For special rules
enum SpecialRuleType {
	NONE = 0, QUEEN, ROOK, BISHOP, KNIGHT, PASSAT, CASTLESHORT, CASTLELONG
};


class Move
{
private:

	int _x1, _y1;		// start square indexes
	int _x2, _y2;		// end square indexes

	SpecialRuleType _specialRule;    // presents one of the enum types

    int charToInt(char c) const;   // Column identifier to X coordinate
    char intToChar(int i) const; // X coordinate to column identifier

public:
    Move();
    Move(int x1, int y1, int x2, int y2);
    Move(SpecialRuleType specialRule);
    Move(int x1, int y1, int x2, int y2, SpecialRuleType specialRule);
    virtual ~Move();

	// Sets move from string description, e.g.
	// "e2-e4"		- set coordinates
	// "O-O"		- set castle short
	// "O-O-O"		- set castle long
	// "e5-d6ep"	- set coordinates and en passant
	// "e7-e8Q"		- set coordinates and promote to queen
	void strToMove(const char* str);

	// Prints move in ascii, e.g. "e2-e4". For testing.
	void print() const;

    //Getters
    int getSpecialRule() const;
	int getX1() const;
	int getY1() const;
	int getX2() const;
	int getY2() const;
};

#endif // _MOVE_H_
